using RomanJendrusz.Amazon.ETL.Infrastructure.Bus;

namespace RomanJendrusz.Amazon.ETL.Messages
{
    public class GetOfferDetailsRequest : AmazonRequest
    {
        public override string Destination
        {
            get { return AwsDestinations.SellerListingLookup; }
        }

        public override string ResponseGroup
        {
            get { return "SellerListing"; }
        }

        public string BookAsin { get; set; }

        public string SellerId { get; set; }

        public string ExchangeId { get; set; }


        public override string ToString()
        {
            return string.Format("Destination : {0} | ResponseGroup : {1} | BookAsin : {2} | SellerId : {3} | ExchangeId : {4}",  Destination, ResponseGroup,
                                 BookAsin, SellerId, ExchangeId);
        }

        public bool Equals(GetOfferDetailsRequest getOfferDetailsRequest)
        {
            if (getOfferDetailsRequest == null) return false;
            if (!base.Equals(getOfferDetailsRequest)) return false;
            if (!Equals(BookAsin, getOfferDetailsRequest.BookAsin)) return false;
            if (!Equals(SellerId, getOfferDetailsRequest.SellerId)) return false;
            if (!Equals(ExchangeId, getOfferDetailsRequest.ExchangeId)) return false;
            return true;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj)) return true;
            return Equals(obj as GetOfferDetailsRequest);
        }

        public override int GetHashCode()
        {
            int result = base.GetHashCode();
            result = 29*result + (BookAsin != null ? BookAsin.GetHashCode() : 0);
            result = 29*result + (SellerId != null ? SellerId.GetHashCode() : 0);
            result = 29*result + (ExchangeId != null ? ExchangeId.GetHashCode() : 0);
            return result;
        }
    }
}